import request from '../utils/request';
import ajax from '../utils/Ajax';
import axiosFunc from '../utils/Axios';
import axiosSendCard from '../utils/Axios_SendCard'

const Get_url = 'http://127.0.0.1:8181/crd_gd.pof?timeout=20&action=1&unit=2';  // 取卡
const Read_Url = 'http://127.0.0.1:8181/crd_gd.pof?timeout=20&dqfs=0&devtype=8'; // 读卡
const Post_url = 'http://192.168.1.161:8080/nofsrv/services'; // 提交数据
const Send_url = 'http://127.0.0.1:8181/crd_gd.pof?timeout=20&action=2'; // 发卡
export function query(values) {
    if (values.type !== 'sendCard') {
        return axiosSendCard({ get: Get_url, read: Read_Url, propsData: Post_url }, { data: values.data }); // 取 读 提交
    } else {
        return axiosFunc(Send_url, { method: 'get' }); // 发卡
    }
}